#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back
#define vec vector<int>

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);return x*sgn;}

const int N = 1e5+10;

int siz[N],n;
vec G[N],st;
bool abl[N];

bool dfs(int x,int k,int p){
	siz[x] = 1;
	for(auto y : G[x]){
		if(y == p) continue;
		int t = dfs(y,k,x); if(!t) return 0;
		siz[x] += siz[y];
	}
	st.clear();
	for(auto y : G[x]) if(y != p && siz[y] % k) st.pb(siz[y] % k);
	sort(st.begin(),st.end());
	int l = 0,r = st.size(); r--; bool have = 0;
	while(l < r){
		if(st[l] + st[r] == k) l++,r--;
		else if(have) return 1;
		else if(st[l] + st[r] > k) r--,have = 1;
		else l++,have = 1;
	}
	if(l == r) return !have;
	else return 1;
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in;
	for(int i = 1,u,v;i < n;i++) u = in,v = in,G[u].pb(v),G[v].pb(u);
	putchar('1');
	for(int i = 2;i < n;i++){
		if(abl[i] || (n - 1) % i) putchar('0');
		else{
			bool t = dfs(1,i,0);
			if(!t) {
				putchar('0');
				for(int j = 2;j * i < n;j++) abl[j * i] = 1;
			}else putchar('1');
		}
	}
	puts("");
	return 0;
}
